Những câu hỏi liên quan
Huyền
Xem chi tiết
Thanh Phong (9A5)
28 tháng 4 2023 lúc 16:21

Uses crt;

var i,t: integer;

begin clrscr;

i:=0;

while(i<=120) do begin

i:=i+1;

t:=t+i;

end;

write(t);

readln;

end.

Bình luận (0)
daukhacgiabao
Xem chi tiết
Nguyễn Huỳnh Khôi Nguyên
Xem chi tiết
Nguyễn Lê Phước Thịnh
1 tháng 5 2021 lúc 19:39

uses crt;

var n,i,s:integer;

begin

clrscr;

write('Nhap n='); readln(n);

s:=0;

i:=1;

while i<=n do 

  begin

s:=s+i;

inc(i);

end;

writeln(s);

readln;

end.

Bình luận (0)
Nguyễn Huỳnh Khôi Nguyên
3 tháng 5 2021 lúc 11:37

ae nào giúp mình với ạ'

 

Bình luận (0)
Chuu
Xem chi tiết
Minh Lệ
6 tháng 3 2023 lúc 23:26

Program HOC24;

uses crt;

var i,n: integer;

s: real;

begin

clrscr;

write('Nhap n: '); readln(n);

s:=0;

for i:=1 to n do s:=s+1/(i*(i+1));

write('S= ',s:6:2);

readln

end.

Bình luận (1)
Minh Lệ
7 tháng 3 2023 lúc 22:52

Program HOC24;

var i,n: integer;

S: real;

begin

write('Nhap N: '); readln(n);

i:=1; s:=0;

while i<=n do

begin

s:=s+i*(i+1);

i:=i+1;

end;

write('S=',S:5:2);

readln

end.

Bình luận (0)
Linh Nhi
Xem chi tiết
Nguyễn Lê Phước Thịnh
4 tháng 3 2022 lúc 9:22

a: uses crt;

var i,n:integer;

s:real;

begin

clrscr;

s:=0;

for i:=1 to 100 do s:=s+1/i;

writeln(s:4:2);

readln;

end.

b: 

uses crt;

var i,n:integer;

s:real;

begin

clrscr;

s:=0;

i:=0;

while i<=100 do 

begin

inc(i);

s:=s+1/i;

end;

writeln(s:4:2);

readln;

end.

Bình luận (0)
Tùng Dương
Xem chi tiết
nguyễn an phát
27 tháng 5 2021 lúc 13:35

program tong_for_to_do;

uses crt;

var i,n:integer;

t:real;

begin

clrscr;

write('nhap n:');readln(n);

t:=0;

for i:=1 to n do

if i mod 3=0 then t:=t+1/i;

writeln('tong la: ',t);

readln;

end.

Bình luận (0)
nguyễn an phát
27 tháng 5 2021 lúc 13:37

program tong_while_do;

uses crt;

var i,n:integer;

t:real;

begin

clrscr;

write('nhap n:');readln(n);

t:=0;i:=3;

while i<=3*n do

begin

t:=t+1/i;

i:=i+3;

end;

writeln('tong la: ',t);

readln;

end.

Bình luận (0)
Nguyễn võ thiện nhân
Xem chi tiết
Nguyễn Lê Phước Thịnh
15 tháng 4 2022 lúc 16:46

uses crt;

var s,n:integer;

begin

clrscr;

s:=20;

n:=1;

while s>=5 do 

begin

n:=n+1;

s:=s-n;

end;

writeln(s);

readln;

end.

Bình luận (0)
Nguyễn Võ Phương Uyên
Xem chi tiết
Ho Truong Minh
Xem chi tiết
Nguyễn Lê Phước Thịnh
7 tháng 4 2022 lúc 22:52

a: Thuật toán sẽ thực hiện 5 vòng lặp

Kết thúc thì S=0

b: uses crt;

var i,s,n:integer;

begin

clrscr;

s:=20;

n:=1;

while (s>=5) do 

begin

n:=n+1;

s:=s-n;

end;

writeln(s);

readln;

end.

Bình luận (0)